package newXgame.hall.object
{
	import anshe.object.ChooseObject;
	
	import flash.display.SimpleButton;
	import flash.display.Sprite;
	import flash.net.SharedObject;
	import flash.text.TextField;
	
	import org.dstart.draw.csuper.CSprite;

	public class UserLoginObject extends CSprite
	{
		public var mcHot:Sprite;			//	热响应区块
		public var bgSprite:Sprite;			//	背景区块
		public var btnLogin:SimpleButton;		//	确定按钮
		public var btnCancel:SimpleButton;		//	取消按钮
		public var btnRegister:SimpleButton;	//	注册按钮
		public var txtUserName:TextField;		//	用户名输入框
		public var txtUserPass:TextField;		//	用户密码输入框
		public var mcSave:ChooseObject;			//	是否记录 SharedObjed 标识
		
		private var so:SharedObject;		//	本地的 SharedObject 类对象
		
		public function UserLoginObject()
		{
			this.txtUserName.text = "";
			this.txtUserPass.text = "";
			this.mcSave.textColor = 0x000000;
			this.mcSave.text = "记住名字";
		}
		
		//	取得对象的原始宽度
		public function get objWidth():Number
		{
			return this.bgSprite.width;
		}
		
		//	取得对象的原始高度
		public function get objHeight():Number
		{
			return this.bgSprite.height;
		}
		
		public override function set visible(value:Boolean):void
		{
			this.mcHot.graphics.clear();
			
			if(value)
			{
				var ww:Number = this.stage.stageWidth + 40 + this.objWidth;
				var hh:Number = this.stage.stageHeight + 40 + this.objHeight;
			
				this.mcHot.graphics.beginFill(0x000000, 0.4);
				this.mcHot.graphics.drawRect(-ww/2, -hh/2, ww, hh);
				this.mcHot.graphics.endFill();
			}
			
			super.visible = value;			
		}
	}
}